User Administration for SQL Server

It is recommended that each user be assigned a personal database account with only the required privileges. For more information, please refer to the SQL Server product documentation.

Note, this topic only provides instructions for performing the setup on the same computer as SQL Server while logged in as the same user that installed SQL Server.

Perform the following steps for any user that will need access to the pdfkeeper database. Substitute the user name and password for user_name and password.

  1. Open a Command Prompt.

  2. Execute sqlcmd -S localhost\<Instance Name>

  1. Enter use pdfkeeper then press <Enter> and then enter go and then press <Enter>.

  2. For a new user, enter the following statement: create user user_name with password = 'password' then press <Enter> and then enter go and then press <Enter>. For more information, see the SQL Server product documentation.

  3. For a new account, enter the following statement to grant the user select/query access: grant select on docs to user_name then press <Enter> and then enter go and then press <Enter>.

  4. To give the user the ability to upload documents, enter the following statement: grant insert on docs to user_name then press <Enter> and then enter go and then press <Enter>.

  5. To give the user the ability to update documents, enter the following statement: grant update on docs to user_name then press <Enter> and then enter go and then press <Enter>.

  6. To give the user the ability to delete documents, enter the following statement: grant delete on docs to user_name then press <Enter> and then enter go and then press <Enter>.

  7. To prevent the user from uploading documents, enter the following statement: revoke insert on docs from user_name then press <Enter> and then enter go and then press <Enter>.

  8. To prevent the user from updating documents, enter the following statement: revoke update on docs from user_name then press <Enter> and then enter go and then press <Enter>.

  9. To prevent the user from deleting documents, enter the following statement: revoke delete on docs from user_name then press <Enter> and then enter go and then press <Enter>.